package com.git_taoxian_test2;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class MovieManager {


//    电影界面方法
    public void start(){
        System.out.println("===欢迎来到黑马影院===");
        Movie movie1 = new Movie("天宫大闹孙悟空","吴承恩","口碑一般",98.7);
        Movie movie2 = new Movie("桃园三结义刘关张","罗贯中","口碑良好",99.2);
        Movie movie3 = new Movie("杨柳倒拔鲁智深","施耐庵","口碑优秀",99.9);

//        Collection接口实现子类对象
        Collection<Movie> movies = new ArrayList<>();
        movies.add(movie1);
        movies.add(movie2);
        movies.add(movie3);

//        利用迭代器打印结果
//        Iterator<Movie> it = movies.iterator();
//        while (it.hasNext()) {
//            Movie rs =  it.next();
//            System.out.println(rs);
//        }

//        加强for循环打印结果
        for(Movie rs: movies){
            System.out.println(rs);
        }

    }
}
